﻿using System.Configuration;

namespace TSharp.Core.Authentication.Facade.Constant
{
    /// <summary>
    /// IAuthorizationService 常量
    /// <para>2010/7/10</para>
    /// 	<para>THINKPADT61</para>
    /// 	<para>tangjingbo</para>
    /// </summary>
    public static class MembershipServiceConst
    {
        /// <summary>
        /// 系统默认token验证的失效时间配置标识（AppSetting）
        /// </summary>
        public static string CONFIGKEY_FORGET_PWD = "ForgetPwdUrlInvalid";

        /// <summary>
        /// 忘记密码链接的有效时间（小时）
        /// </summary>
        public static int InvalidHour = 24;

        /// <summary>
        /// 找回密码时url用户名标识
        /// </summary>
        public static string URLKEY_USERNAME = "k";

        /// <summary>
        /// 自定义签名信息
        /// </summary>
        public static string URLKEY_CUSTOMINFO = "c";

        static MembershipServiceConst()
        {
            string v = ConfigurationManager.AppSettings.Get(CONFIGKEY_FORGET_PWD);

            if (!int.TryParse(v, out InvalidHour))
                InvalidHour = 24; //默认
            //tokenTimeSpan = TimeSpan.FromHours(hour);
        }
    }
}